import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '@/pages/HomePage.vue'
import StaticProvide from '@/pages/StaticProvide.vue'
import ReactiveProvide from '@/pages/ReactiveProvide.vue'
import AsyncProvideError from '@/pages/AsyncProvideError.vue'

// 定义路由配置
const routes = [
  {
    path: '/',
    name: 'home',
    component: HomePage,
  },
  {
    path: '/static-provide',
    name: 'static-provide',
    component: StaticProvide,
  },
  {
    path: '/reactive-provide',
    name: 'reactive-provide',
    component: ReactiveProvide,
  },
  {
    path: '/async-provide-error',
    name: 'async-provide-error',
    component: AsyncProvideError,
  },
]

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes,
})

export default router
